package com.cetcs.kmga.dataManager.dao.mybatis;

import com.cetcs.kmga.common.Data;
import com.cetcs.kmga.dataManager.entity.device.DeviceInfo;
import com.cetcs.kmga.dataManager.entity.device.DeviceNumber;
import com.cetcs.kmga.dataManager.entity.device.DeviceStatusLineChart;
import com.github.miemiedev.mybatis.paginator.domain.PageBounds;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * 设备管理dao
 * Created by yyangs on 2017/8/23 0021.
 */
@Repository
public interface DeviceManagerMapper {


    /**
     * 通过id获取设备信息
     * @param dataMap
     * @return
     * @throws Exception
     */
    DeviceInfo getDeviceInfoById(Data dataMap) throws Exception;
    //通过条件获取所有的设备信息
    List<DeviceInfo> getDeviceInfosByCondition(Data dataMap) throws Exception;
    List<DeviceInfo> getDeviceInfosByCondition(Data dataMap,PageBounds pageBounds) throws Exception;
    //创建设备信息
    Integer createDeviceInfo(Data dataMap) throws Exception;
    //更新设备信息
    Integer updateDeviceInfo(Data dataMap) throws Exception;
    //删除设备信息
    Integer deleteDeviceInfo(Data dataMap) throws Exception;
    //判断 设备是否存在
    Integer isExistDevice(Data dataMap) throws Exception;


    //通过条件和类型 获取每个类型设备的数量
    List<DeviceNumber> getTotalNumByTypeAndCondition(Data data) throws Exception;
    //通过条件和类型 获取每个类型设备非正常运行的数量
    List<DeviceNumber> getNotActiveNumByTypeAndCondition(Data data) throws Exception;
    //通过条件获取所有的设备信息和设备状态
    List<DeviceInfo> getDeviceInfosAndStatusByCondition(Data dataMap) throws Exception;



    //获取设备状态折线图
    List<DeviceStatusLineChart> getDeviceStatusLineChart(Data dataMap) throws Exception;
}
